<%@ tag pageEncoding="UTF-8" %>
<%--页面采用typescript的形式响应，只要提供根类就行,其他的所有ts依赖由RequireJS统一加载
其中的css js placehoder是母板页面的占位--%>
<%@ attribute name="css" fragment="true" required="false" %>
<%@ attribute name="js" fragment="true" required="false" %>
<%@ attribute name="placeholder" fragment="true" required="true" %>
<%@ attribute name="tsFileName" required="true" %>
<%@ attribute name="tsPath" required="false" %>

<!Doctype html>
<html>
<head>
    <jsp:include page="/pages/_header.jsp"/>
    <jsp:invoke fragment="css"/>
</head>

<body>
<div id="wrapper">
    <div id="page-wrapper" style="margin: 20px">
        <jsp:invoke fragment="placeholder"/>
    </div>
    <!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
<jsp:include page="/pages/_footer.jsp"/>
<jsp:invoke fragment="js"/>

<script src="/js/legacy/require.js"></script>
<script type="application/javascript">
    //requireJS的模块加载，和TS在一起时有一定的冲突
    function module(jsPath, rootClassName){
        require.config({
            baseUrl: "/js/js/" + jsPath.toLowerCase()
        });

        //console.log(rootClassName)
        require(rootClassName.indexOf(",")? rootClassName.split(","): [rootClassName], function () {
            console.log("requireJS Module " + rootClassName);
        },function () {
            console.log("module fail")
        });

    }
    module("${empty tsPath ? tsFileName: tsPath}", "${tsFileName}")
</script>

</body>
</html>
